package com.example.demo.service;

import com.example.demo.mapper.AdministratorMapper;
import com.example.demo.pojo.Administrator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-12-05 19:12
 */
@Service
public class AdministratorServiceImpl implements AdministratorService {
    @Autowired
    AdministratorMapper administratorMapper;

    /**查询管理员列表*/
    @Override
    public List<Administrator> Administratorlist() {
        return administratorMapper.Administratorlist();
    }
    /**管理员列表数量*/
    @Override
    public Integer Administratorlistnumber() {
        return administratorMapper.Administratorlistnumber();
    }

    /**添加数据*/
    @Override
    public void Administratoraddtijiao(String username, String password, String email) {
        administratorMapper.Administratoraddtijiao(username,password,email);
    }

    /**修改1查看对应信息*/
    @Override
    public Administrator Administratorupdate(Integer adminid) {
        return administratorMapper.Administratorupdate(adminid);
    }
    /**修改2插入信息*/
    @Override
    public void Administratorupdatetijiao(Integer adminid1, Integer adminid2, String username, String password, String email) {
        administratorMapper.Administratorupdatetijiao(adminid1,adminid2,username,password,email);
    }

    /**删除*/
    @Override
    public void Administratdelete(Integer adminid) {
        administratorMapper.Administratdelete(adminid);
    }

    /**管理员登陆*/
    @Override
    public Administrator logincheck(String username, String password) {
        return administratorMapper.logincheck(username,password);
    }
}
